package com.kczd.jinlan.view.order.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.kczd.jinlan.R;
import com.kczd.jinlan.adapter.CompLetedAdapter;
import com.kczd.jinlan.model.Goods;

import java.util.ArrayList;
import java.util.List;

/**
 * yang_g
 * 已完成
 * Created by Administrator on 2017/5/17.
 */

public class CompletedFragment extends Fragment {

    private View view;
    private ListView list_view_completed;
    private List<Goods> datas;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        view =inflater.inflate(R.layout.completed_fragment,null);
        data();
        init();
        return view;
    }

    private void init() {
        list_view_completed = (ListView) view.findViewById(R.id.list_view_completed);
        list_view_completed.setAdapter(new CompLetedAdapter(datas));
    }

    private List<Goods> data() {
        datas = new ArrayList<>();
        for (int i = 0; i <20 ; i++) {
            Goods goods = new Goods();
            goods.setTitle("新鲜蔬菜 黄瓜");
            goods.setWeight_dai("5斤装x2");
            goods.setPrice("￥14.00");
            goods.setPay_time("2017-04-21");
            goods.setCount_this("共2个");
            goods.setSumprice("￥28.00");
            goods.setYunfei("含运费￥6.00");
            datas.add(goods);
        }
        return datas;
    }
}
